home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 4
/
Precision Software Applications Silver Collection Volume 4 (1993).iso
/
new
/
gpal101g.exe
/
GPAL.DOC
< prev
next >
Wrap
Text File
|
1993-08-11
|
7KB
|
242 lines
GPAL v1.01 (C) Copyright 1993 Peak Computing
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Designed & Written by Brian Manning
* What is GPAL?
GPAL is a collection of graphic palette fading routines for VGA display
adapters. These routines work in all graphic video modes (1,2,7,8,9,10,
11,12 & 13, remember the video adapter MUST BE VGA or better). And work
together with QuickBASIC's internal text routines (including PALETTE &
PALETTE USING). These routines directly modify the video's internal
palette registers for blazing speed verses using the PALETTE commands.
* How do I use GPAL?
These routines are very simple to use, first load QuickBASIC (or BASCOM 7.1)
with the 'Quick Library' file for your version of BASIC (BC7GPAL or QBGPAL).
Usually like so:
QBX /L BC7GPAL (BASCOM 7.1)
QB /L QBGPAL (QuickBASIC)
Then you'll want to include the file 'GPAL.BI' like so:
' $INCLUDE: 'GPAL.BI'
After that your ready to begin calling the routines. The first routine you
want to call is 'InitGPALDriver' this routine intializes the video card and
gets the current default palette settings. After doing this all the other
routines you just call whenever you want graphic fading or to create effects!
* Routine Summary:
Name: InitGPALDriver
Initializes the video card & routines. This routine uses some of
BASIC's heap to store some video card settings. The space used by
this routine is 784 bytes.
-> NOTE: Always call this routine after
changing the video palette settings
or after calling the CLEAR statement,
if you don't the fading will not work right!
InitGPALDriver
Name: GBlankPalette
Blanks out the palette. (Sets to black)
Speed% = 1
GBlankPalette Speed%
Speed% - 0 for instant, 1 for a slow 'dissolve' effect
Name: GSavePalette
Saves a palette to disk, if no extention is given, the routine
will assume the extention .PAL (See GLoadPalette)
FileName$ = "TEST"
GSavePalette FileName$
FileName$ - Filename to save palette as. (May include path)
Name: GLoadPalette
Loads a palette from disk, if no extention is given the routine
will assume the extention .PAL (See GSavePalette)
FileName$ = "TEST"
GLoadPalette FileName$, ErrCode%
FileName$ - Palette filename to load. (May include path)
-----
ErrCode% - 0 no error
-1 Not a GPAL file
Name: GStorePalette
Stores a copy of the current palette in memory. Storing a palette in
memory requires only 768 bytes. GStorePalette can hold upto 5 palettes in
memory at one time. (See GRestorePalette)
-> NOTE: The copy of the palette is stored in BASIC's heap,
thus if you call the CLEAR statement, you will erase
the stored palette.
Index% = 0
GStorePalette Index%
Index% - Range 0-4, you may store upto 5 palettes in memory by specifying
an index.
Name: GRestorePalette
Restores the stored palette in memory. Sets it in the palette registers
so it becomes the current palette. (See GStorePalette)
-> NOTE: The copy of the palette is stored in BASIC's heap,
thus if you call the CLEAR statement, you will erase
the stored palette.
Index% = 1
GRestorePalette Index%
Index% - Range 0-4, you may store upto 5 palettes in memory by specifying
an index.
Name: GFadeInPalette
Fades a graphic palette into view. (See GFadeOutPalette)
FadeSpeed% = 3
GFadeInPalette FadeSpeed%
FadeSpeed% - 1-10, 1 being the slowest
(Use 0 for instant palette set)
Name: GFadeOutPalette
Fades a palette out of view. (See GFadeInPalette)
FadeSpeed% = 3
GFadeOutPalette FadeSpeed%
FadeSpeed% - 1-10, 1 being the slowest
Name: GrafLoad
Loads a graphic screen from disk to screen, also loads a graphic screen
stored in an EXE file. When loading images attached to EXE files you
must be using screen 13 (320x200x256 MCGA) or you will get "Video Mode
not supported" error. Also loading images from EXE files requires 97k free
of drive space on the users end, as GrafLoad creates a temp. file. Loading
images from EXE files is also much slower because GrafLoad must find the
image and palette first in the EXE file. Use ADDIMAGE to attach an image
to an EXE file. (See GrafSave)
FileName$ = "TEST.GRA"
Options% = 7
GrafLoad FileName$, Options%, ErrCode%
FileName$ - Filename of image to load. When loading images from EXE files
just specify the name, GrafLoad will sense if it is an EXE file or
not. (May include path)
Options% - 0 = Load image only, no palette
1 = Load palette before image
2 = Load palette after image
3+ = Fade-in palette after image
(Add three to the fade speed you want, for ex.: if you want
a fade speed of 4 then you add 4+3 and get 7)
-----
ErrCode% - 0 Loaded okay
-1 Error in palette file
-2 No image in EXE file
-3 Video mode not supported
-4 Not a valid graphic format
-5 File not found
Name: GrafSave
Saves a graphic screen to disk. (See GrafLoad)
FileName$ = "TEST.GRA"
GrafSave FileName$
FileName$ - Filename to save screen as. (May include path)
Name: GSetBright
This routine is used for setting the brightness level of the screen.
Brightness% = 31
GSetBright Brightness% ' Set the display to 50% brightness
Brightness% - Range 1-63, brightness (intensity) level of the screen.
(use 0 to restore the brightness level)
Name: MoveDisplay
Moves the display up/down/left/right with a 'panning' effect.
xAxis% = 5
yAxis% = 0
MoveDisplay xAxis%, yAxis%
xAxis% - Horizontal alignment (use 0 to restore proper setting)
yAxis% - Vertical alignment (use 0 to restore proper setting)
Name: GPal
GPal sets the palette in screen mode 13, this routine lets you set the
RGB palette intensity. You can create upto 256,000 colors!
Colour% = 1
Red% = 40
Green% = 40
Blue% = 40
GPal Colour%, Red%, Green%, Blue%
Colour% - The color to set the new palette to (range 0-255)
Red% - Red palette intensity
Green% - Green palette intensity
Blue% - Blue palette intensity
* Notes:
These routines are designed to use very little heap space, the most these
routines will use is 2k (2000 bytes).
I've included QwikHelp(C) into the 'GPAL.BI' file. If you need help with
a routine, move the cursor under the routine name and press 'F1' from
there you will get some quick information on that routine! (Saves alot
of time!)
(QwikHelp (C) Copyright 1993 Peak Computing)